<?php
  
  /**
  * User.php
  * 
  * o SSC Pattern (c) 2009 Ersin Güvenç
  * o Super Static Controllers : User | Loader | Ob
  *  
  * Just Put your common special functions here !! "user" 
  * class works everywhere except helper files. So you 
  * should put your common functions
  * of your application which interested in 
  * these categories..  
  * 
  *    o site navigation menu func.,
  *    o authentication functions
  *    o module functions
  *    o and your other special functions that
  *    you often use them for whole application.
  * 
  * WARNING !: it will work for everywhere like this 
  * "user::yourfunction()", if your function is a global 
  * (if every controllers use this function) you should put it
  * here, if its not a global function don't put it here 
  * because of your app performance ..
  *  
  */
  
// use it UserException for your special app errors
// like this throw new UserException('error');  
Class UserException extends CommonException{} 

Class __autoloader {
    
    function __construct()
    {
        // autoload libraries, helpers, lang, config files etc..        
         loader::base(array());
        // loader::library(array());
        // loader::helper(array());
        // loader::base_helper(array());  // load automatically ob shortcuts functions.
        // loader::model(array());
        // loader::lang(array());
        // loader::base_lang(array());
        // loader::config(array());
    }   
}

Class user extends __autoloader
{
      public $base     = 'http://localhost/obullo/';
      public $base_img = 'base/views/images/';
      
      // Build html your base html contents
      public $title_tag = '';
      public $head_tag  = '';
      public $body_tag  = '';
      public $h1  = '';
      public $h2  = '';
      public $h3  = '';
                                              
      public function __user()
      {
          parent::__construct();
                                              
          $this->base     = config_item('base_url');
          $this->base_img = config_item('base_img');
      }
                                                     
      public function __header()
      {
          // this is header for every function
          $this->title_tag = 'Default common title tag for every page !';
          $this->body_tag  = 'Default body tag for every page !';
      } 
      
      // this is parent index() methods for all index() methods...
      public function __index(){}
      
} // end class.
  
  
?>
